import { request} from "../request/index";

export const getOrderInfo = (userid) =>{
  return  request({
    url: "/order/"+userid+"/",
    method:"get",
})
}

export const setOrderInfo = (id,state) =>{
  return request({
    url: "/order/"+id+"/",
    method:"PUT",
   data:{
       state
   }
  });
}

export const deleteOrderOne = (userid,id) =>{
  return request({
    url: "/order/"+userid+"/",
    method:"delete",
    data:{
        order_id:id,  
    }
});   
}

export const createOrderOne = (userid,goods_id,time,number,state) =>{
  return request({
    url: "/order/",
    method:"POST",
    data:{
        goods_id:goods_id,
        userid:userid,
        num:number,
        ordertime:time,
        state
    }
}); 
}

